package typejump.util;
import java.util.Hashtable;

/**
 * Generic class which wraps around a hashtable which uses Strings as keys
 * @author g
 *
 * @param <S>
 */
public class StateKeeper<S> {

	private Hashtable<String, S> table = new Hashtable<String, S>();
	private S def;
	
	public StateKeeper(S def) {
		this.def = def;
	}
	
	public S get(String s) {
		if (table.containsKey(s))
			return table.get(s);
		return def;
	}
	
	public void set(String s, S value) {
		table.put(s,  value);
	}
}
